import { _decorator, Component, Node, Prefab } from 'cc';
import { LayerCatAction } from './LayerCatAction';
import { Globals } from './Globals';
import { LayerSlotAction } from './LayerSlotAction';
import { LayerRootAction } from './LayerRootAction';
const { ccclass, property } = _decorator;

@ccclass('MainAction')
export class MainAction extends Component {

    @property({type: LayerCatAction})
    layerCatAction: LayerCatAction = null;

    @property({type: LayerSlotAction})
    layerSlotAction: LayerSlotAction = null;

    //layerrootaction
    @property({type: LayerRootAction})
    layerRootAction: LayerRootAction = null;

    //等级预制体
    @property({type: Prefab})
    levelPrefab: Prefab = null;

    //钉子预制体
    @property({type: Prefab})
    pinPrefab: Prefab = null;

    start() {
        Globals.MainAction = this;
        // this.layerCatAction.init();
        this.startGame();
    }

    update(deltaTime: number) {
        
    }

    //游戏开始
    startGame(lvl: number = 1) {
        this.layerRootAction.startGame(lvl);
    }
}


